package io.netty.test.main.bio;

import java.io.IOException;
import java.net.Socket;

/**
 * @author LuoYu
 * @date 2018/10/27 15:31
 * <p>
 * Description:
 */
public class Client {
    private static final String HOST = "127.0.0.1";
    private static final int PORT = 8080;

    public static void main(String[] args) throws IOException {
//        final Socket socket = new Socket(HOST,PORT);

        new Thread(() -> {
            for (int i = 0; i < 66; i++) {

                String message = "hello world";
                System.out.println("send message:" + message + i);
                try {
                    Socket socket = new Socket(HOST,PORT);
                    socket.getOutputStream().write((message+i).getBytes());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

        }).start();
    }

}
